package com.yonyou.brigade.third_parties.ctripBC.service;

import com.alibaba.fastjson.JSONObject;
import com.yonyou.brigade.basic_init.model.BriChannel;
import com.yonyou.brigade.third_parties.ctripBC.model.CtripBCConfig;
import com.yonyou.brigade.third_parties.ctripBC.model.CtripBCUser;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public interface ICtripBCPublicService {
    String ssoMobileLogin(String employeeId, HttpServletResponse response, CtripBCConfig ctripBCConfig, String initPage, int tokenType) throws IOException ;

    String ssoPCLogin(String employeeId, HttpServletResponse response, CtripBCConfig ctripBCConfig, String initPage, int tokenType) throws IOException ;

    boolean syncCtripBCUsers(List<CtripBCUser> ctripBCUsers, CtripBCConfig config, BriChannel briChannel);

    /**
     * 这个同步人员方法用于设置二次授权人
     * @param ctripBCUsers
     * @param config
     * @param email
     */
    void  syncCtripBCUsers(List<CtripBCUser> ctripBCUsers, CtripBCConfig config , String email, BriChannel briChannel);

    String doRMIOrdersSearch(String startDate, String endDate, CtripBCConfig ctripBCConfig);

    /**
     * 调用飞机的携程结算明细接口
     */
    String SearchSettlementFlightOrder(String startDate, String endDate, CtripBCConfig ctripBCConfig);

    /**
     * 调用酒店的携程结算明细接口
     */
    String SearchSettlementHtlOrder(String startDate, String endDate, CtripBCConfig ctripBCConfig);

    /**
     * 调用火车的携程结算明细接口
     */
    String SearchSettlementTrainOrder(String startDate, String endDate, CtripBCConfig ctripBCConfig);

    /**
     * 调用用车的携程结算明细接口
     */
    String SearchSettlementCarOrder(String startDate, String endDate, CtripBCConfig ctripBCConfig);


    /**
     * @description: 按照订单号和产品类别拉取订单
     * @since 2019-01-26
     */
    String doOrdersSearch(String searchType, String orderIds, CtripBCConfig ctripBCConfig);

    /**
     * 向携程商旅通推送申请单
     * @param channel
     * @param tenant
     * @param orgpk
     * @param applyOrderJson
     * @return
     */
    JSONObject pushApplayOrder(BriChannel channel, String tenant, String orgpk, JSONObject applyOrderJson, boolean isOpenApi);

    /*
        关闭申请单同步到携程大客户
     */
    List closeApplyOrder(BriChannel channel , JSONObject trip);

    boolean syncAllUsersToCtripBC(String tenant, String orgPk, Integer openType, BriChannel briChannel);
}
